<template>
  <div>
    <div class="tit">
      <div class="list">
        <div class="li" @click="shouye">
          <img src="../../../assets/logo.png" />
          <!-- <span>帮帮同城</span> -->
        </div>
        <div class="rig">
          <div class="sousuo" v-if="showSearch">
            <input type="text" v-model="searchtext" @keyup.enter="search2" placeholder="请输入关键字查找" />
            <p class="el-icon-search" @click="search2"></p>
          </div>
          <dh></dh>
        </div>
      </div>
    </div>
    <!-- <transition name="el-fade-in">
      <div class="erweima" v-if="ewmStatus">
        <div><img src="../../../assets/android.png" /><span>安卓</span></div>
        <div><img src="../../../assets/iosDown.png" /><span>IOS</span></div>
        <i
          class="el-icon-close"
          style="
            position: absolute;
            top: 3px;
            color: #000;
            font-size: 20px;
            right: 20px;
          "
          @click="yc()"
        ></i>
      </div>
    </transition> -->
  </div>
</template>

<script>
import dh from "./download-head";
export default {
  components: {
    dh,
  },
  props: {
    showSearch: {
      type: Boolean,
      default: false,
    },
    customEvent: {
      type: Boolean,
      default: false,
    },
  },
  name: "second-head",
  data() {
    return {
      searchtext: "",
      ewmStatus: false,
    };
  },
  methods: {
    search2() {
      if (this.customEvent) {
        this.$emit("search", this.searchtext);
        return;
      }
      this.openUrlb("/index/bigSearch", {
        search: this.searchtext,
      });
    },
    shouye() {
      this.$router.push({
        path: "/",
      });
    },
    search() {
      this.openUrl({
        path: "/index/houseSearch",
        query: {
          search: this.searchtext,
        },
      });
    },
    showCode() {
      console.log(111);
      this.ewmStatus = true;
    },
    yc() {
      console.log(222);
      this.ewmStatus = false;
    },
  },
};
</script>

<style lang="less" scoped>
.tit {
  width: 100%;
  height: 100px;
  background-color: #f2f2f2;

  .list {
    position: relative;
    display: flex;
    align-content: center;
    justify-items: center;
    width: 1200px;
    margin-left: 50%;
    padding-top: 25px;
    transform: translateX(-50%);
    background-color: #f2f2f2;

    div {
      display: inline-block;
      vertical-align: middle;
      font-size: 20px;
      color: #333333;
    }

    .li {
      cursor: pointer;
      font-size: 28px;
      color: #64b6a8;
      margin-right: 60px;

      img {
        /* width: 60px;
	        height: 60px; */
      }

      span {
        vertical-align: middle;
      }
    }

    .rig {
      margin-left: auto;

      .sousuo {
        position: relative;
        display: block;
        width: 380px;
        height: 50px;
        background: #ffffff;
        border-radius: 4px;
        font-size: 18px;
        overflow: hidden;
        display: inline-block;

        input {
          width: 300px;
          height: 55px;
          line-height: 55px;
          text-indent: 16px;
          font-size: 18px;
        }

        img {
          width: 25px;
          height: 25px;
          margin-left: 20px;
          cursor: pointer;
        }

        p {
          position: absolute;
          top: 0;
          right: 0;
          width: 80px;
          height: 55px;
          background-color: #64b6a8;
          text-align: center;
          line-height: 55px;
          font-size: 24px;
          cursor: pointer;
          color: #ffffff;
        }
      }

      .but {
        width: 200px;
        height: 50px;
        background: #64b6a8;
        border-radius: 6px;
        text-align: center;
        line-height: 50px;
        color: #fff;
        margin-left: 30px;
      }
    }
  }
}

.erweima {
  position: fixed;
  right: 20%;
  top: 164px;
  z-index: 99999;
  background-color: #f7f0f0;
  padding: 20px;
  border-radius: 5px;
  display: flex !important;
  margin-right: 10px !important;

  div {
    margin-right: 10px !important;
    z-index: 99999;
    display: flex !important;
    flex-direction: column;
    align-items: center;

    img {
      width: 150px;
      height: 150px;
    }

    span {
      color: #000;
    }
  }
}</style>
